package com.lovo.web.controller;

import com.lovo.web.bean.EsBean;
import com.lovo.web.service.IEsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/es")
public class EsController {
      @Autowired
      private IEsService esService;
      /**
       * 添加到两个数据库
       *
       * @param entity
       */
      @RequestMapping("add")
      public String add(EsBean entity) {
            esService.add(entity);
            return "ok";
      }
      
      @RequestMapping("findContext")
      public EsBean findContext(String id) {
            return esService.findContext(id);
      }

      
      
}

